﻿// JScript ファイル

 /*┗◎◎┛=====================================================================
 *
 *【画面名】
 *      編集画面
 *
 *【概要】
 *?     検索候補値画面
 *      em_fn     ： EntityManagerフール名
 *      obj     　：ボタンID
 *
 *      hidLandId必要です、検索候補値画面表示用
 *【変更履歴】
 *┗◎◎┛====================================================================*/
function show_point(em_fn,obj)
{
    var hid = obj.parentNode.childNodes[0];
    var hid_id = hid.id;
    var hid_name = hid.name;
    var txt = obj.parentNode.childNodes[1]
    var txt_name = txt.name;
    
    var hid_point = hid_name.substr(hid_name.indexOf("_hid_"),hid_name.length);
    var targaet_name = hid_point.substr(5,hid_point.length)
    var target_objid = hid_id;
    
    for(var i=0;i<form1.elements.length;i++)
    {
        var o = form1.elements[i];
        
        if(o.type == "hidden" && o.name.indexOf(hid_point) > 0)
        {
            if(o.name.indexOf(hid_point) + hid_point.length == o.name.length)
            {
                var obj_t = o.parentNode.childNodes[1];
                target_objid = target_objid + "," + obj_t.id;
                targaet_name = targaet_name + "," + obj_t.name.split('txt_')[1];
            }
        }
    }

    //page url
    var url = "../../main/comm/EditPointList.aspx";
    
    //lang,EntityManager
    if(document.getElementById("hidLandId") == null)
    {
        url = url + "?EM_FN=" + em_fn;
    }
    else
    {
        url = url + "?lang_id=" + document.getElementById("hidLandId").value;
        url = url + "&EM_FN=" + em_fn;
    }
    
    //cur obj
    url = url + "&CUR_NAME=" + txt_name.split('txt_')[1];
    
    //targaet name
    url = url + "&TARGET_NAME=" + targaet_name;
    
    //targaet boj
    url = url + "&TARGET_OBJ=" + target_objid;
    
    //all
    url = url + "&ALL=";
    
    var wndEdCandidate = window.open(url, 'wndEdCandidate', 'width=410,height=520,resizable=yes,scrollbars=no,status=yes');
    wndEdCandidate.focus();
    
}
function show_point(em_fn,obj,actionType,actionParam)
{

    var hid = obj.parentNode.childNodes[0];
    var hid_id = hid.id;
    var hid_name = hid.name;
    var txt = obj.parentNode.childNodes[1]
    var txt_name = txt.name;

    var hid_point = hid_name.substr(hid_name.indexOf("_hid_"),hid_name.length);
    var targaet_name = hid_point.substr(5,hid_point.length)
    var target_objid = hid_id;

    for(var i=0;i<form1.elements.length;i++)
    {
        var o = form1.elements[i];
        
        if(o.type == "hidden" && o.name.indexOf(hid_point) > 0)
        {
            if(o.name.indexOf(hid_point) + hid_point.length == o.name.length)
            {
                var obj_t = o.parentNode.childNodes[1];
                target_objid = target_objid + "," + obj_t.id;
                targaet_name = targaet_name + "," + obj_t.name.split('txt_')[1];
            }
        }
    }

    //page url
    var url = "../../main/comm/EditPointList.aspx";
    if (em_fn == "csoftech.storeSelect")
    {
        url = "../../main/csoftech/StoreSelect.aspx";
    }
    else if (em_fn == "csoftech.userSelect")
    {
        url = "../../main/csoftech/UserSelect.aspx";
    }

    //lang,EntityManager
    if(document.getElementById("hidLandId") == null)
    {
        url = url + "?EM_FN=" + em_fn;
    }
    else
    {
        url = url + "?lang_id=" + document.getElementById("hidLandId").value;
        url = url + "&EM_FN=" + em_fn;
    }
    
    //cur obj
    url = url + "&CUR_NAME=" + txt_name.split('txt_')[1];
    
    //targaet name
    url = url + "&TARGET_NAME=" + targaet_name;
    
    //targaet boj
    url = url + "&TARGET_OBJ=" + target_objid;
    
    //all
    //url = url + "&ALL=";
    
    //actiontype
    if (em_fn == "csoftech.userSelect")
    {
        url = url + "&ACT=" + actionType;
    }
    //actionParam
    if (em_fn == "csoftech.storeSelect" || em_fn == "csoftech.userSelect")
    {
        url = url + "&PARAM=" + actionParam;
    }
    var wndEdCandidate;
    if (em_fn == "csoftech.storeSelect")
    {
        wndEdCandidate = window.open(url, 'wndEdCandidate', 'width=1010,height=540,resizable=yes,scrollbars=yes,status=yes');
    }    
    else if (em_fn == "csoftech.userSelect")
    {
        wndEdCandidate = window.open(url, 'wndEdCandidate', 'width=610,height=540,resizable=yes,scrollbars=yes,status=yes');
    }
    else
    {
        wndEdCandidate = window.open(url, 'wndEdCandidate', 'width=410,height=540,resizable=yes,scrollbars=yes,status=yes');
    }
    wndEdCandidate.focus();    
}